package com.hadron.media.slideshow.items 
{
	import com.hadron.transitions.behaviors.ITransitionBehavior;
	import com.hadron.transitions.TransitionableCoreSprite;
	/**
	 * Base class for all SlideshowItem types.
	 * @author Hadron
	 */
	public class AbstractSlideshowItem extends TransitionableCoreSprite implements ISlideshowItem
	{
		private var _content:*;
		private var _transitionBehavior:ITransitionBehavior;
		protected var _loader:*;
		
		public function AbstractSlideshowItem() 
		{
			super();			
		}
		
		override public function transitionIn():void
		{
			super.transitionIn();
			transitionBehavior.transitionIn();
		}
		
		override public function transitionOut():void
		{
			super.transitionOut();
			transitionBehavior.transitionOut();
		}
		
		/* INTERFACE components.slideshow.ISlideshowItem */
		public function set content(value:*):void
		{
			this._content = value;
		}
		
		public function get content():*
		{
			return _content;
		}
		
		public function get loader():*
		{
			return _loader;
		}
		
		public function set transitionBehavior(value:ITransitionBehavior):void
		{
			if (value is ITransitionBehavior)
			{
				_transitionBehavior = value;
			} else {
				throw new Error('argument must be ITransitionBehavior typed!');
			}
		}
		
		public function get transitionBehavior():ITransitionBehavior
		{
			return _transitionBehavior;
		}
	}
}